# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Compute.V1.Model.ResourcePolicyInstanceSchedulePolicy do
  @moduledoc """
  An InstanceSchedulePolicy specifies when and how frequent certain operations are performed on the instance.

  ## Attributes

  *   `expirationTime` (*type:* `String.t`, *default:* `nil`) - The expiration time of the schedule. The timestamp is an RFC3339 string.
  *   `startTime` (*type:* `String.t`, *default:* `nil`) - The start time of the schedule. The timestamp is an RFC3339 string.
  *   `timeZone` (*type:* `String.t`, *default:* `nil`) - Specifies the time zone to be used in interpreting Schedule.schedule. The value of this field must be a time zone name from the tz database: https://wikipedia.org/wiki/Tz_database.
  *   `vmStartSchedule` (*type:* `GoogleApi.Compute.V1.Model.ResourcePolicyInstanceSchedulePolicySchedule.t`, *default:* `nil`) - Specifies the schedule for starting instances.
  *   `vmStopSchedule` (*type:* `GoogleApi.Compute.V1.Model.ResourcePolicyInstanceSchedulePolicySchedule.t`, *default:* `nil`) - Specifies the schedule for stopping instances.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :expirationTime => String.t() | nil,
          :startTime => String.t() | nil,
          :timeZone => String.t() | nil,
          :vmStartSchedule =>
            GoogleApi.Compute.V1.Model.ResourcePolicyInstanceSchedulePolicySchedule.t() | nil,
          :vmStopSchedule =>
            GoogleApi.Compute.V1.Model.ResourcePolicyInstanceSchedulePolicySchedule.t() | nil
        }

  field(:expirationTime)
  field(:startTime)
  field(:timeZone)

  field(:vmStartSchedule,
    as: GoogleApi.Compute.V1.Model.ResourcePolicyInstanceSchedulePolicySchedule
  )

  field(:vmStopSchedule,
    as: GoogleApi.Compute.V1.Model.ResourcePolicyInstanceSchedulePolicySchedule
  )
end

defimpl Poison.Decoder, for: GoogleApi.Compute.V1.Model.ResourcePolicyInstanceSchedulePolicy do
  def decode(value, options) do
    GoogleApi.Compute.V1.Model.ResourcePolicyInstanceSchedulePolicy.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Compute.V1.Model.ResourcePolicyInstanceSchedulePolicy do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
